import {RouteRecordRaw} from "vue-router";

/*
* 路由页面
* */

const routes: RouteRecordRaw[] = [
    {
        // 首页
        path: "/",
        name: "index",
        component: () => import("../view/Index/Index.vue"),
        redirect: "/home",
        children: [
            {
                path: "/home",
                name: "home",
                component: () => import("../view/Index/Home/Home.vue"),
                meta: {
                    title: "主页",
                    isAuth:true
                }
            },
            {
                path: "/phonebook",
                name: "phonebook",
                component: () => import("../view/Index/Phonebook/Phonebook.vue"),
                meta: {
                    title: "通讯录",
                    isAuth:true
                }
            },
            {
                path: "/user",
                name: "user",
                component: () => import("../view/Index/User/User.vue"),
                meta: {
                    title: "我",
                    isAuth:true
                }
            }
        ]
    },
    {
        // 登录页
        path: "/login",
        name: "login",
        component: () => import("../view/Login/Login.vue"),
        meta: {
            title: "登陆",
            isAuth:false
        }
    },
    {
        // 注册页
        path: "/register",
        name: "register",
        component: () => import("../view/Register/Register.vue"),
        meta: {
            title: "注册",
            isAuth:false
        }
    },
    {
        // 搜索
        path: "/search",
        name: "search",
        component: () => import("../view/Search/Search.vue"),
        meta: {
            title: "搜索",
            isAuth: true
        }
    },
    {
        // 编辑用户信息
        path: "/userEdit",
        name: "userEdit",
        component: () => import("../view/UserEdit/UserEdit.vue"),
        meta: {
            title: "编辑",
            isAuth: true
        }
    },
    {
        // 显示好友信息
        path: "/showFriend",
        name: "showFriend",
        component: () => import("../view/ShowFriend/ShowFriend.vue"),
        meta: {
            title: "好友",
            isAuth: true
        }
    },
    {
        // 同意好友
        path: "/agreeWith",
        name: "agreeWith",
        component: () => import("../view/AgreeWith/AgreeWith.vue"),
        meta: {
            title: "同意好友",
            isAuth: true
        }
    },
    {
        //聊天页面
        path: "/chatPage",
        name: "chatPage",
        component: () => import("../view/ChatPage/ChatPage.vue"),
        meta: {
            title: "聊天",
            isAuth: true
        }
    },
]

export default routes